<template>
  <div class="today">
    <div class="title">历史同期天气</div>
    <el-row class="top">
      <el-col :span="4" class="top-date">日期</el-col>
      <el-col :span="5" class="top-max">最高温度</el-col>
      <el-col :span="5" class="top-min">最低温度</el-col>
      <el-col :span="5" class="top-avg">平均温度</el-col>
      <el-col :span="5" class="top-pcpn">降水量</el-col>
    </el-row>
    <template v-for="item in today" :key="item">
      <el-row class="value">
        <el-col :span="4" class="date">{{ item.date }}</el-col>
        <el-col :span="5" class="maxtmp">{{ item.maxtmp }}</el-col>
        <el-col :span="5" class="mintmp">{{ item.mintmp }}</el-col>
        <el-col :span="5" class="avgtmp">{{ item.avgtmp }}</el-col>
        <el-col :span="5" class="pcpn">{{ item.pcpn }}</el-col>
      </el-row>
    </template>
  </div>
</template>

<script setup>
const props = defineProps({
  today: {
    type: Object,
  },
});
</script>

<style lang="less" scoped>
.today {
  border-radius: 16px;
  background-color: #f7f8f9;
  border: 1px solid #f2f4fa;
  padding: 30px 16px 20px;
  margin-bottom: 16px;
  .title {
    font-size: 20px;
    font-weight: 500;
    line-height: 22px;
    text-align: center;
    margin-bottom: 20px;
  }
  .top {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    height: 40px;
    margin-bottom: 6px;
    text-align: center;
    align-items: center;
    color: rgba(0, 0, 0, 0.5);
  }
  .value {
    max-width: 800px;
    margin: 0 auto;
    white-space: nowrap;
    text-align: center;
    align-items: center;
    border-radius: 11px;
    background-color: rgba(0, 0, 0, 0.03);
    padding: 0 16px;
    height: 40px;
    margin-bottom: 6px;
  }
}
</style>